package com.xmy.cultivate.controller;

import com.xmy.cultivate.entity.LklMerchantStudent;
import com.xmy.cultivate.entity.Recruit;
import com.xmy.cultivate.service.ILklMerchantService;
import com.xmy.cultivate.service.ILklMerchantStudentService;
import com.xmy.cultivate.service.ILklMerchantTeacherService;
import com.xmy.cultivate.util.Code;
import com.xmy.cultivate.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 学习支付使用的帐号 前端控制器
 * </p>
 *
 * @author hpiggy
 * @since 2025-03-21
 */
@RestController
@RequestMapping("/api/lklMerchantStudent")
public class LklMerchantStudentController {

    @Autowired
    ILklMerchantStudentService iLklMerchantStudentService;
    @Autowired
    ILklMerchantService iLklMerchantService;
    @Autowired
    ILklMerchantTeacherService iLklMerchantTeacherService;

    @PostMapping("/saveMerchantStudentBatch")
    public Result saveMerchantStudentBatch(@RequestBody List<LklMerchantStudent> lklMerchantStudentList) {

        boolean saveBatch = iLklMerchantStudentService.saveBatch(lklMerchantStudentList);
        if (saveBatch) {
            return new Result(Code.SAVE_OK, "", "保存成功");
        }
        return new Result(Code.SAVE_ERROR,"","保存失败");

    }

}
